
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="/houtai/js/vue.js"></script>
    <script type="text/javascript" src="/houtai/js/jquery-2.1.4.js"></script>
    <link rel="stylesheet" href="/houtai/layuiadmin/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="/houtai/layuiadmin/style/body.css">
</head>
<body>
<div class="layui-container" style="left: 25%">
    <form class="layui-form layui-form-pane" lay-filter="orderDeploy" id="orderDeploy">
        <div class="layui-form-item" style="width: 800px;margin-top: 30px;">
            <div class="layui-form-mid layui-word-aux">正常订单超过:</div>
            <div class="layui-input-block" style="float: left;margin-left: -1px;">
                <input type="text" name="ordertime" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label" style="width: 50px;text-align: center;float: left;margin-left: -2px;background-color: gainsboro">分</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 10px">未付款，订单自动关闭</div>
        </div>
        <div class="layui-form-item" style="width: 800px">
            <div class="layui-form-mid layui-word-aux" style="margin-left: 30px">发货超过:</div>
            <div class="layui-input-block" style="float: left;margin-left: -3px">
                <input type="text" name="deliverytime" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label" style="width: 50px;text-align: center;float: left;margin-left: -2px;background-color: gainsboro">天</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 10px">未收货，订单自动完成</div>
        </div>
        <div class="layui-form-item" style="width: 800px">
            <div class="layui-form-mid layui-word-aux">订单完成超过：</div>
            <div class="layui-input-block" style="float: left;margin-left: -10px">
                <input type="text" name="completetime" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label" style="width: 50px;text-align: center;float: left;margin-left: -2px;background-color: gainsboro">天</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 10px">自动结束交易，不能申请售后</div>
        </div>
        <div class="layui-form-item" style="width: 800px">
            <div class="layui-form-mid layui-word-aux">订单完成超过：</div>
            <div class="layui-input-block" style="float: left;margin-left: -10px">
                <input type="text" name="evaluatetime" autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label" style="width: 50px;text-align: center;float: left;margin-left: -2px;background-color: gainsboro">天</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 10px">自动五星好评</div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="updateDeploy">提交</button>
            </div>
        </div>
    </form>
</div>

<script src="/houtai/layuiadmin/layui/layui.js" charset="utf-8"></script>

<script>
    layui.use(['form','jquery'], function(){
        var form = layui.form;
        var $ = layui.jquery;
        var result = null;
        //各种基于事件的操作
        $(function () {
            $.ajax({
                url:"/houtai/page/deploy/orderdeploy/list",
                type:"get",
                dataType:"json",
                success:function (data) {
                    result=data.li[0];
                    //给表单赋值
                    form.val('orderDeploy', {
                        "ordertime": result.ordertime   // "name": "value"
                        ,"deliverytime": result.deliverytime
                        ,"completetime": result.completetime
                        ,"evaluatetime":result.evaluatetime
                    });
                }
            });
        });
        form.on('submit(updateDeploy)', function (data) {
            $.ajax({
                url: "/houtai/page/deploy/orderdeploy/update",
                type: "post",
                data: $("#orderDeploy").serialize()+"&id=1",
                dataType: "json",
                success: function (data) {
                    /*if ("success" == data.message) {
                        layer.msg(data.message);
                    }*/
                }
            })
        });

    });
</script>
</body>
</html>
